<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <f:loadBundle basename="com.sucresale.utilities.SucreSale-PageMessages" var="pageMessages"/>

    <f:view>
        <h:head>
            <title>#{pageMessages.MAIN_PAGE_TITLE_MESSAGE}</title>
            <link type="text/css" rel="stylesheet" href="THEME/skin.css"/>
        </h:head>
        <h:body>

            <center>
                <p:panel closable="false" header="#{pageMessages.MAIN_PAGE_PANEL_TITLE}" style="width: 600px;height: 20%;text-align: center" >

                    <h:panelGrid columns="2">      

                        <h:panelGrid columns="1">
                            <h:form>
                                <h:panelGrid columns="2">
                                    <h:outputLabel  value="#{pageMessages.MAIN_PAGE_USERNAME_LABEL}" />
                                    <h:inputText id="username" value="#{UserAdminManagedBean.username}"/>
                                    <h:outputLabel value="#{pageMessages.MAIN_PAGE_PASSWORD_LABEL}" />
                                    <h:inputSecret value="#{UserAdminManagedBean.password}"/>
                                    <p:watermark for="username" value="Enter your email Address"/>

                                </h:panelGrid>
                                <p:commandButton action="#{UserAdminManagedBean.checkCredentials}" value="#{pageMessages.MAIN_PAGE_CREDENTIAL_CHECK}" style="width: 300px" ajax="false"/>

                            </h:form>

                        </h:panelGrid>

                        <h:panelGrid columns="1">

                            <h:form>
                                <p:commandButton value="#{pageMessages.MAIN_PAGE_NEW_USER}" oncomplete="newUserDialog.show()"/>

                                <hr/>

                                <p:commandLink action="#{UserAdminManagedBean.forgotYourPassword}" value="#{pageMessages.MAIN_PAGE_FORGOT_YOUR_PASSWORD}"/>

                            </h:form>
                        </h:panelGrid>
                    </h:panelGrid>




                    <p:dialog closable="true" resizable="false" closeOnEscape="true" draggable="false" header="Nuevo Usuario" modal="true" widgetVar="newUserDialog" showEffect="fold" hideEffect="fold" height="200" width="400">

                        <h:form>

                            <h:panelGrid columns="2">

                                <h:outputLabel value="Email"/>
                                <h:inputText/>

                                <h:outputLabel value="Password"/>
                                <h:inputText/>

                                <h:outputLabel value="Address"/>
                                <h:inputText/>

                                <h:commandButton value="submit" action="#{UserAdminManagedBean.createNewUser}"/>

                            </h:panelGrid>

                        </h:form>

                    </p:dialog>


                </p:panel>

            </center>
        </h:body>

    </f:view>
</html>

